import LinkStore from "../storage/linkstore";

function echo(params) {
  return params;
}

function add(params) {
  let linkInfo = params.linkInfo;

  LinkStore.add(linkInfo);
}

function update(params) {
  let linkInfo = params.linkInfo;

  LinkStore.update(linkInfo.id, linkInfo);
}

function remove(params) {
  let id = params.id;
  LinkStore.remove(id);
}

function list(params) {
  let like = params.like;

  return LinkStore.list(like);
}

function get(params) {
  let id = params.id;

  let result = LinkStore.get(id);

  console.log(result);

  return result;
}

function reset(params) {
  console.log(params);
  return LinkStore.reset();
}

export default { echo, add, update, remove, list, get, reset };
